import ENV from '@/config/env.js';
import request from '@/utils/request';
const ApiUrl = ENV.API_URL;

export default {
  /**
   * 登录
   **/
  login(data) {
    return new Promise((success, error) => {
      request({ url: ApiUrl + '/pos4/user/login/wx-applet', method: "POST", data, success, error });
    });
  },
  /**
   * 列表用户注册的门店
   **/
  listStore() {
    return new Promise((success, error) => {
      request({ url: ApiUrl + '/pos4/user/user/list-store', method: "GET", success, error });
    });
  },
  /**
   * 注册为会员
   **/
  registerToMember(data) {
    return new Promise((success, error) => {
      request({ url: ApiUrl + '/pos4/member/user/register-to-member', method: "POST", data, success, error });
    });
  },
  /**
   * 获取钱包余额
   **/
  getWalletAmount() {
    return new Promise((success, error) => {
      request({ url: ApiUrl + '/pos4/member/user/get-wallet-amount', method: "GET", success, error });
    });
  }
};
